import "./assets/index.css";

import { createApp } from "vue";
import { retrieveLaunchParams } from "@telegram-apps/sdk-vue";

import {  Popup,Button  } from "vant";

import "vant/lib/index.css";

import App from "./App.vue";
import router from "./router";
import { errorHandler } from "./errorHandler";
import { init } from "./init";
import { TonConnectUIPlugin } from "./tonconnect";
import { publicUrl } from "./helperts/publicUrl";

// import { ZegoExpressEngine } from "zego-express-engine-webrtc";

// Mock the environment in case, we are outside Telegram.
import "./mockEnv";

// Configure all application dependencies.
init(retrieveLaunchParams().startParam === "debug" || import.meta.env.DEV);

const app = createApp(App);

// const appID = 152514410;
// const server = "wss://webliveroom433619208-api.coolzcloud.com/ws";

// 初始化 zego 引擎
// const ZegoEngine = new ZegoExpressEngine(appID, server);

// 将 zegoEngine 初始化并挂载到全局
// app.config.globalProperties.$zego = ZegoEngine;

app.config.errorHandler = errorHandler;
app.use(router);
app.use(Popup).use(Button);
app.use(TonConnectUIPlugin, {
  manifestUrl: publicUrl("tonconnect-manifest.json"),
});
app.mount("#app");
